import 'package:flutter/material.dart';

void main() {
  runApp(const MaterialApp(home: Main()));
}

class Main extends StatefulWidget {
  const Main({super.key});

  @override
  _MainState createState() => _MainState();
}

class _MainState extends State<Main> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        color: Colors.black38,
        width: 200,
        height: 200,
        // EdgeInsets.all 四个方向
        //padding: const EdgeInsets.all(20),
        // formLTRB 按照 左上右下设置
        // padding: const EdgeInsets.fromLTRB(10, 20, 30, 40),
        // only 可以只设置一个方向
        padding: const EdgeInsets.only(left: 20),
        child: Container(
          // 如果不设置宽高，默认占满父容器
          color: Colors.amber,
          // margin: const EdgeInsets.only(left: 10, right: 20),
          // vertical 设置上下 horizontal 设置左右
          margin: const EdgeInsets.symmetric(vertical: 20, horizontal: 10),
        ),
      ),
    );
  }
}
